﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Fractal
{
    public class MathData
    {
        //一堆公共变量声明

        //画布大小
        public static int presetWidth = 640;
        public static int presetHeight = 480;

        public static int w_left = 0;//画布左上角坐标，可以不是0，我们这里让他是0，没有必要不是0
        public static int w_top = 0;

        //四个重要参数，用于放大缩小！描述的是 分形图的逻辑大小，跟实际画布大小完全不一样。
        public static decimal pmin = -2;
        public static decimal pmax = 2;
        public static decimal qmin = -2;
        public static decimal qmax = 2;

        public static int m_deep = 500;//逃逸半径，超过这个就算无穷大！
        public static int m_Times = 400;//最大迭代次数，也就是逃逸时间

        //三原色，颜色分量
        public static int red;
        public static int green;
        public static int blue;

        //用来指定 绘制图形的 种类，即 绘制哪种图形，取值为 1 2 3 4 5
        public static int method;

        //用来指定Julia和Mandelbrot的阶数
        public static int iterTimes = 2;

        //用于普通MJ集的颜色hue
        public static double th;

        #region 以下是牛顿迭代法的专有变量！！！！

        public static int RAND_MAX = 0x7fff;

        #region  colorMover的各种变量
        public static double m_kR;  //颜色变化强度
        public static double m_kG;
        public static double m_kB;
        public static double m_R0;  //初始颜色
        public static double m_G0;
        public static double m_B0;

        public static int csMaxColorRoundValue = 512;
        #endregion

        public static double m_ColorK1;
        public static double m_ColorK2;
        public static double m_ColorK3;
        public static bool m_IsExtract3Ex;
        public static long m_ExtractNumber;
        public static bool m_isTanRev;
        public static long m_iteratInc;
        public static int rand = 32000;

        public static ulong[] colorRound_table = new ulong[(csMaxColorRoundValue + 1) * 2];


        #endregion

        #region  Julia和Mandelbrot专有变量！

        public static double p;
        public static double q;
        public static double x0;
        public static double y0;
        public static double x;
        public static double y;
        public static double r;


        public static decimal dec_x0, dec_y0, dec_x, dec_y, dec_r, dec_dp, dec_dq, dec_p, dec_q;
        public static decimal dec_pmax, dec_pmin, dec_qmax, dec_qmin;

        public static int trackBarColorMoverValue = 0;

        //逃逸时间的系数
        public static int rMover = 2;
        public static int gMover = 4;
        public static int bMover = 3;

        //随机颜色rdm100次数
        public static int rdmTimes_red = 2;
        public static int rdmTimes_green = 1;
        public static int rdmTimes_blue = 3;

        //广义MJ集的系数
        public static int general_MJ2 = 1;
        public static int general_MJ3 = 1;
        public static int general_MJ4 = 1;
        public static int general_MJ5 = 1;

        #endregion

    }
}
